package bot.controller;

import bot.mapper.GroupHelpMapper;
import bot.pojo.GroupHelp;
import bot.pojo.GroupHelpExample;
import net.sf.json.JSONArray;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController//获取群帮助
@RequestMapping("/group")
public class GroupHelpController {
    private GroupHelpExample groupHelpExample = new GroupHelpExample();
    @Autowired
    private GroupHelpMapper groupHelpMapper;
    @GetMapping("/helplist")
    public String helplist(){
        groupHelpExample.clear();
        List<GroupHelp> groupHelps = groupHelpMapper.selectByExample(groupHelpExample);
        JSONArray jsonArray = JSONArray.fromObject(groupHelps);
        return jsonArray.toString();
    }
}
